package org.jeecg.common.handler;


import org.jeecg.common.model.BaseImportModel;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 初始化数据
 * @author mzz
 */
@Service
public class InitializationService implements InitializingBean {

    @Autowired
    private List<BaseImportModel> importModels;

    @Override
    public void afterPropertiesSet() {
        if(!CollectionUtils.isEmpty(importModels)){
            for (BaseImportModel importModel : importModels) {
                ImportModelHandler.importModelMap.put(importModel.moduleName(),importModel);
            }
        }
    }

}
